<!DOCTYPE html>
<html lang="zh-CN" style="background-color: #D9E7F7;">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>端口选择</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        .container {
            height: 100vh;
        }

        .login-card {
            position: relative;
            width: 85%;
            height: 80vh;
            margin: 40px auto 0;
            background: #FFFFFF;
            border-radius: 12px;
            padding: 30px 20px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        }

        .header {
            text-align: center;
            margin-bottom: 40px;
        }

        .header .main-title {
            color: #000;
            font-size: 20px;
            font-weight: bold;
        }

        .form {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 30px;
        }

        .btn {
            width: 250px;
            height: 120px;
            border-radius: 16px;
            display: inline-block;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            border: none;
            box-shadow: 0 4px 12px rgba(41, 121, 255, 0.3);
            cursor: pointer;
        }

        .btn-text {
            color: #000;
            font-size: 24px;
            margin-top: 10px;
            font-weight: bold;
        }
        .btn-con{
            text-align: center;
            align-items: center;
        }

        .btn img {
            width: 40px;
            height: 40px;
        }

        .family-btn {
            display: flex;
            text-align: center;
            align-items: center;
            background: #7EBBF9;
        }

        .elder-btn {
            display: flex;
            text-align: center;
            align-items: center;
            background: #FFB45D;
        }

        .help-btn {
            position: fixed;
            right: 20px;
            bottom: 30px;
            display: flex;
            align-items: center;
            background: none;
            border: none;
            cursor: pointer;
        }

        .help-text {
            color: #A5A5A8;
            font-size: 14px;
            margin-left: 4px;
        }

        .help-btn img {
            width: 20px;
            height: 20px;
        }

        /* 加载动画 */
        .loading-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(255, 255, 255, 0.8);
            display: none;
            justify-content: center;
            align-items: center;
        }

        .loading-spinner {
            border: 4px solid #f3f3f3;
            border-top: 4px solid #2979FF;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="login-card">
            <div class="header">
                <div class="main-title">请选择使用端口</div>
            </div>

            <div class="form">
                <button class="btn family-btn" onclick="selectPort('family')">
                    <div class="btn-con">
                        <img src="https://www.ruanzi.net/jy/wxuser/103/images/pages/子女端.png" alt="子女端图标">
                        <span class="btn-text">子女端</span>
                    </div>
                </button>

                <button class="btn elder-btn" onclick="selectPort('elder')">
                    <div class="btn-con">
                        <img src="https://www.ruanzi.net/jy/wxuser/103/images/pages/老人端.png" alt="老人端图标">
                        <span class="btn-text">老人端</span>
                    </div>
                </button>
            </div>

            <button class="help-btn" onclick="showHelp()">
                <img src="https://www.ruanzi.net/jy/wxuser/103/images/pages/帮助.png" alt="帮助图标">
                <span class="help-text">帮助</span>
            </button>
        </div>

        <!-- 加载动画 -->
        <div class="loading-overlay" id="loading">
            <div class="loading-spinner"></div>
        </div>
    </div>

    <script>
        // 显示加载状态
        function showLoading() {
            document.getElementById('loading').style.display = 'flex';
        }

        // 隐藏加载状态
        function hideLoading() {
            document.getElementById('loading').style.display = 'none';
        }

        // 选择端口
        function selectPort(type) {
            showLoading();
            setTimeout(() => {
                hideLoading();
                if(type === 'family') {
                    window.location.href = './we103108.htm';
                } else {
                    window.location.href = './we103104.htm';
                }
            }, 500);
        }

        // 显示帮助
        function showHelp() {
            const helpContent = `根据您的身份选择对应端口：
            \n子女端：亲属监护功能
            \n老人端：长者服务功能`;
            
            if(confirm(helpContent)) {
                // 确认后的回调
            }
        }
    </script>
</body>
</html>